﻿using System;
using System.Collections.Generic;
using System.Text;
using MyExcelAddIn2003.ComOPHelper;
using HardwareLibrary.LogLibrary;

namespace MyExcelAddIn2003.Core
{
    class VBAfunc
    {
        public static void VBA_listinit()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("listFrm_Load", Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch(Exception ex)
            {
                LogManager.WriteLog(LogFile.Error, ex.Message);
            }
            
        }
        public static void listFrm_dataGridView1_CellDoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("listFrm_dataGridView1_CellDoubleClick", Type.Missing, Type.Missing,
                       Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                       Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                       Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                       Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                       Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
            
        }
        /// <summary>
        /// 计量再次确认窗口采毛事件
        /// </summary>
        /// <param name="WT_llmz">真实毛重</param>
        /// <param name="WT_bcmz">当前毛重</param>
        /// <param name="WTTime">采毛时机（一次计量时采毛，还是二次计量时采毛）</param>
        public static void WTSencondCheckFrm_CaiMao_Click(string WT_zsmz,string WT_dqmz,int WTTime)
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("CaiMao_Click", WT_zsmz, WT_dqmz, WTTime, Type.Missing, 
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
            
        }
        /// <summary>
        /// 采注册皮重
        /// </summary>
        /// <param name="WTTime">采皮时机</param>
        public static void WT_CaiRegisterPi(int WTTime)
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("WT_CaiRegisterPi", WTTime, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        /// <summary>
        /// 计量再次确认窗口采皮事件
        /// </summary>
        /// <param name="WT_zspz">真实皮重</param>
        /// <param name="WT_dqpz">当前皮重</param>
        public static void WTSencondCheckFrm_CaiPi_Click(string WT_zspz, string WT_dqpz, int WTTime)
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("CaiPi_Click", WT_zspz, WT_dqpz,
                   WTTime, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                   Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }

        }
        public static void WeightFrm_addBtn_Click()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("addBtn_Click", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
            
        }
        public static void WeightFrm_saveBtn_Click(int WTTime)
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("saveBtn_Click", WTTime, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
            
        }
        public static void PrintBill(string printName,int WTTime)
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("printBtn_Click", printName, WTTime,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void WeightFrm_textBox_IDCardNum_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_IDCardNum_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void WeightFrm_FormLoad()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("WeightFrm_FormLoad", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void WeightFrm_FormClosed()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("WeightFrm_FormClosed", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void WeightFrm_textBox_chmc_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_chmc_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch{ }
        }
        public static void textBox_sflb_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_sflb_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_bdrq_MouseDoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_bdrq_MouseDoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_sfdh_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_sfdh_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_htdm_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_htdm_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_ggxh_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_ggxh_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_ksmc_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_ksmc_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_cydw_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_cydw_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_cd_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_cd_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_jhlb_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_jhlb_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_xhdd_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_xhdd_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_fhdd_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_fhdd_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_pczh_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_pczh_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_yffs_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_yffs_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_jsfs_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_jsfs_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_xhck_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_xhck_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_fhck_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_fhck_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_jly_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_jly_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_kpy_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_kpy_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_jby_DoubleClick()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_jby_DoubleClick", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        /// <summary>
        /// 创建单据ID事件
        /// </summary>
        public static void CreateBillID_Event()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("CreateBillID_Event", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void UpdateBillID_Event()
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("UpdateBillID_Event", Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void ClearTextBox_Event(string TextBoxName)
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("ClearTextBox_Event", TextBoxName, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch { }
        }
        public static void textBox_pczh_Leave(string TextValue)
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("textBox_pczh_Leave_Event", TextValue, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch
            {
            }
        }
        public static void TextBox_TextChanged(string TextName)
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("TextBox_TextChanged_Event", TextName, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch
            {
            }
        }
        public static void DelFirstWTData(string WTid)
        {
            try
            {
                if (Utility.DataIsRuningBackgroud == true) return;
                OPHelper oph = new OPHelper();
                oph.ChangeBackGroundFlag(true);
                Globals.ThisAddIn.Application.Run("DelFirstWTData_Event", WTid, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch
            {
            }
        }
    }
}
